When a subject is photographed against light, an image of the subject becomes an ambiguous backlit image. This backlit image has such low brightness and contrast that the details thereof are difficult to discriminate. Overexposure or underexposure, blurring and out-of-focus in shooting an object, noise, or insufficient light intensity also may be cause of degradation in image quality. However, quality of such poor-quality images can be improved by executing processing on image data for enhancing the brightness and contrast thereof. Retinex processing has been known as one of such processing to improve image quality.
In Retinex processing, data of a high image quality portion is maintained, while image quality of a low image quality portion is improved. In Retinex processing, each pixel data of the original image is corrected to a value in which pixel data of surrounding pixels are reflected, using a Gaussian filter. Then, reference component data of the original image is calculated from natural logarithm of the corrected pixel data. Illuminance component data is calculated by dividing the pixel data of the original image by the pixel component of the original image. That is, the original image is divided into reference component and illuminance component. A processing, such as a gamma correction, for correcting brightness and contrast, is performed on the illuminance component. Thereafter, the corrected illuminance component and the reference component are composed to generate image data in which the low quality portion, such as a backlit image portion, has been improved in image quality in comparison to the original image.
US 2004/0091164 A1 discloses a method of speeding up Retinex processing. In this method, as shown in FIG. 1, an original image is first converted into a reduced image (having a low resolution) by means of an average pixel method or the like, and a peripheral average luminance image (blurring image) is formed by obtaining a peripheral average luminance for each pixel of the reduced image. Then, a Retinex-processed image (Retinex image) is formed from an enlarged blurring image and the original image. An output image is formed from the Retinex image and the original image.
In FIG. 1, x represents a transverse coordinate, y represents a longitudinal coordinate, and I (x, y) represents a pixel value (gray value) of the original image and the reduced image. In order to form the blurring image from the reduced image, convolution operation is performed, using F (x, y) as a filter coefficient. The following equation (1) expresses the convolution operation:F(x,y)*I(x,y)  (1)
R (x, y) in FIG. 1 represents a pixel value of the Retinex image, and Out (x, y) represents that of the output image.
Because the Retinex image is obtained from the enlarged blurring image and the original image in the above-described method, the calculation amount is large, taking much time for the calculations. Also, normalized values must be used when forming the output image, and in order to normalize values, minimum and maximum values of the pixels of the Retinex image are detected, and a histogram is formed, and upper and lower values are clipped. Therefore, a memory for temporarily storing the Retinex image is required.